package org.example.model;


import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_article")
@ApiModel(value = "Article对象", description = "文章表")
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "作者id")
    private Long userId;

    @ApiModelProperty(value = "类型id")
    private Long categoriesId;

    @ApiModelProperty(value = "文章标题")
    private String title;

    @ApiModelProperty(value = "文章封面（url路径）")
    private String cover;

    @ApiModelProperty(value = "文章描述")
    private String description;

    @ApiModelProperty(value = "摘录")
    private String excerpt;

    @ApiModelProperty(value = "文章内容")
    private String context;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


    @TableField(exist = false)
    @ApiModelProperty(value = "文章类型")
    private Categories categories;

    @ApiModelProperty(value = "文章标签")
    @TableField(exist = false)
    private List<Tag> tagList;
}
